/**
*@Author: QWP
*@Description: 是否 选择的下拉数据
*@Params: type 为空 则不带全部  type 存在任意值则带全部筛选
*@Date 2023-08-23 15:02
*/
export const isSel = (type = '') => {
  const data = [
    {id: '0', value: '0', name: '否', label: '否'}, 
    {id: '1', value: '1', name: '是', label: '是'}
  ]
  if(type != '') {
    return [
      {id: '', value: '', name: '全部', label: '全部'},
      ...data 
    ]
  }
  return data
}
export const isSel1 = (type = '') => {
  const data = [
    {id: 0, value: 0, name: '否', label: '否'}, 
    {id: 1, value: 1, name: '是', label: '是'}
  ]
  if(type != '') {
    return [
      {id: '', value: '', name: '全部', label: '全部'},
      ...data 
    ]
  }
  return data
}

/**
*@Author: QWP
*@Description: 枚举的props
*@Date 2023-08-29 15:50
*/
export const enumProps = {
  label: 'name'
}

// 报销的paytype 对应的 附件 bucket 和 biztype
// 以及 审核时的 busType
export const paytypeToFinpay = {
  1: ['3', 'TRAVEL'], // 差旅报销
  2: ['4', 'OFFICIAL'], // 办公
  3: ['5', 'MEETING'], // 会议
  4: ['6', 'TRAIN'], // 培训
  5: ['7', 'RECEPTION'], // 接待
  6: ['8', 'PROCURE'], // 采购报销
  7: ['9', 'PROPER'], // 物业报销
  8: ['10', 'CAR'], // 车辆报销
  9: ['19', 'ASSET'], // 资产购置报销
  10: ['20', 'APPLYOTHER'], // 事前其他事项报销
  11: ['21', 'TEMPPAY'], // 暂付款
  12: ['22', 'RECEIPTS'], // 暂收款 / 往来资金
  13: ['23', 'CASE'], // 涉案资金
  99: ['11', 'OTHER'], // 其他
}

// 临时地区枚举
export const regions = []

// 临时单位枚举
export const units = []

// 临时部门枚举
export const depts = [
  { label: '办公室', value: '1',},
  { label: '法规和宣传处', value: '2',},
  { label: '综合协调处', value: '3',},
  { label: '安全监管和执法处', value: '4',},
  { label: '督导检查处', value: '5',},
  { label: '应急指挥和预案管理处', value: '6',},
  { label: '防灾减灾处(地震处)', value: '7',},
  { label: '危化品监管处', value: '8',},
  { label: '基层基础处', value: '9',},
  { label: '科技信息化处', value: '10',},
  { label: '调查和监测预警处', value: '11',},
  { label: '机关党委(人事处)', value: '12',},
]

// 临时人员的枚举
export const users = [
  { label: '丁艳玲', value: '1',},
  { label: '马权', value: '2',},
  { label: '杨鑫', value: '3',},
  { label: '张三', value: '4',},
  { label: '李四', value: '5',},
]

// 临时年度的枚举
export const years = (maxRear = 50) => {
  let tData = [];
  for(let i = 1; i <= maxRear; i++) {
    tData.push({ label: `${i}年`, value: i })
  }
  return tData
}

// 临时审核状态
export const statusA = (type = 1) => {
  if(type == 1) {
    return [
      { label: '录入', value: '1'},
      { label: '审核中', value: '2'},
      { label: '审核完成', value: '3'},
      { label: '被退回', value: '4'},
    ]
  }
  else if(type == 2) {
    return [
      { label: '待审核', value: '2'},
      { label: '曾经办', value: '3'},
    ]
  }
}

// 临时的单位/部门人员数
export const getDeptUser  = () => {
  return units.forEach(i => {
    i.title = i.label;
    i.key = i.value;
    i.children = depts.map(id => {
      return {
        title: id.label,
        key: `${i.key}-${id.value}`,
        children: users.map(iu => {
          return {
            title: iu.label,
            key: `${i.key}-${id.value}-${iu.value}`
          }
        })
      }
    })
  })
}

// 学历
export const educations = [
  {label: '小学', value: '0'},
  {label: '初中', value: '1'},
  {label: '高中', value: '2'},
  {label: '大专', value: '3'},
  {label: '本科', value: '4'},
  {label: '硕士', value: '5'},
  {label: '博士', value: '6'},
].reverse()

// 性别
export const sexs = [
  {label: '女', value: 0},
  {label: '男', value: 1},
]

// 职称级别
export const techLevels = [
  {label: '初级', value: '0'},
  {label: '中级', value: '1'},
  {label: '副高', value: '2'},
  {label: '正高', value: '3'},
]

// 数字对应汉字
export const numberToText = (value) => {
  var units = ['', '十', '百', '千', '万', '十万', '百万', '千万', '亿'];
  var digits = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
 
  var result = String(value).replace(/./g, function(digit, index, array) {
    return digits[Number(digit)] + units[array.length - index - 1];
  });
 
  return result.replace('一十', '十');
}

// 民族
export const nationalitys = [{"label":"汉族","value":"汉族"},{"label":"壮族","value":"壮族"},{"label":"满族","value":"满族"},{"label":"回族","value":"回族"},{"label":"苗族","value":"苗族"},{"label":"维吾尔族","value":"维吾尔族"},{"label":"土家族","value":"土家族"},{"label":"彝族","value":"彝族"},{"label":"蒙古族","value":"蒙古族"},{"label":"藏族","value":"藏族"},{"label":"布依族","value":"布依族"},{"label":"侗族","value":"侗族"},{"label":"瑶族","value":"瑶族"},{"label":"朝鲜族","value":"朝鲜族"},{"label":"白族","value":"白族"},{"label":"哈尼族","value":"哈尼族"},{"label":"哈萨克族","value":"哈萨克族"},{"label":"黎族","value":"黎族"},{"label":"傣族","value":"傣族"},{"label":"畲族","value":"畲族"},{"label":"傈僳族","value":"傈僳族"},{"label":"仡佬族","value":"仡佬族"},{"label":"东乡族","value":"东乡族"},{"label":"高山族","value":"高山族"},{"label":"拉祜族","value":"拉祜族"},{"label":"水族","value":"水族"},{"label":"佤族","value":"佤族"},{"label":"纳西族","value":"纳西族"},{"label":"羌族","value":"羌族"},{"label":"土族","value":"土族"},{"label":"仫佬族","value":"仫佬族"},{"label":"锡伯族","value":"锡伯族"},{"label":"柯尔克孜族","value":"柯尔克孜族"},{"label":"达斡尔族","value":"达斡尔族"},{"label":"景颇族","value":"景颇族"},{"label":"毛南族","value":"毛南族"},{"label":"撒拉族","value":"撒拉族"},{"label":"布朗族","value":"布朗族"},{"label":"塔吉克族","value":"塔吉克族"},{"label":"阿昌族","value":"阿昌族"},{"label":"普米族","value":"普米族"},{"label":"鄂温克族","value":"鄂温克族"},{"label":"怒族","value":"怒族"},{"label":"京族","value":"京族"},{"label":"基诺族","value":"基诺族"},{"label":"德昂族","value":"德昂族"},{"label":"保安族","value":"保安族"},{"label":"俄罗斯族","value":"俄罗斯族"},{"label":"裕固族","value":"裕固族"},{"label":"乌孜别克族","value":"乌孜别克族"},{"label":"门巴族","value":"门巴族"},{"label":"鄂伦春族","value":"鄂伦春族"},{"label":"独龙族","value":"独龙族"},{"label":"塔塔尔族","value":"塔塔尔族"},{"label":"赫哲族","value":"赫哲族"},{"label":"珞巴族","value":"珞巴族"}]

// 政治面貌
export const policys = [{"label":"中国共产党党员","value":"中国共产党党员"},{"label":"中国共产党预备党员","value":"中国共产党预备党员"},{"label":"中国共产主义青年团团员","value":"中国共产主义青年团团员"},{"label":"中国国民党革命委员会会员","value":"中国国民党革命委员会会员"},{"label":"中国民主同盟盟员","value":"中国民主同盟盟员"},{"label":"中国民主建国会会员","value":"中国民主建国会会员"},{"label":"中国民主促进会会员","value":"中国民主促进会会员"},{"label":"中国农工民主党党员","value":"中国农工民主党党员"},{"label":"中国致公党党员","value":"中国致公党党员"},{"label":"九三学社社员","value":"九三学社社员"},{"label":"台湾民主自治同盟盟员","value":"台湾民主自治同盟盟员"},{"label":"无党派民主人士","value":"无党派民主人士"},{"label":"群众","value":"群众"}]